<?php
class Views_Helpers_ShowAllVideo extends Zend_View_Helper_Abstract{
        public $view;
        public function setView(Zend_View_Interface $view){
            $this->view = $view;
        }

	public function showAllVideo(){
            $jquery = $this->view->jQuery();
            $jquery->enable();
            $jqHandler = ZendX_JQuery_View_Helper_JQuery::getJQueryHandler();
            $function = ' ' . file_get_contents(dirname(__FILE__) . '/ShowCreamStars.js');
            if($jqHandler == '$') $jqHandler = '';
            $jquery->addOnload($jqHandler . $function);

            $tagsStr = '';
            $tags = $this->view->tags;

            foreach($tags as $onetagid => $onetagname){
                $tagsStr .= '
                    <li><a href="' . $onetagid . '" class="localnavigation">' . $onetagname['key'] . '</a></li>
                    ';
            };

            $newvideoStr = '';
            $newvideos = $this->view->newVideos;

            foreach($newvideos as $onevideo){
                $newvideoStr .= '
                    <div class="creammagShortNewsPost">
                        <img alt="" src="/img/n002.jpg" />
                        <h2 class="clear" style="margin-bottom:5px;">' . $onevideo->getDescription() . '</h2>
                        <div style="margin-left:3px;" class="cream_stars" id="creamstardiv17" alt="' . $onevideo->getTotalViews() . '"><img src="/img/all_creamstars.png" alt="CreamStar"/></div>
                        <div class="creammagdots" style="height: 5px; margin-top:5px;"></div>
                        <div><a href="' . $onevideo->getProfileUrl() . '" class="localauthor"><span class="pen"></span><span class="newsauthor">' . $onevideo->getProfileName() . '</span></a><a href="#" class="localcomments"><span class="comment"></span><span class="newsauthor">' . $onevideo->getTotalComments() . '</span></a></div>
                    </div>
                    ';

            };

            $popvideoStr = '';
            $popvideos = $this->view->popularVideos;

            foreach($popvideos as $onevideo){
                $popvideoStr .= '
                    <div><p class="creammagPShort">&gt;&nbsp;<a href="' . $onevideo->getProfileUrl() . '" class="localauthorshort">' . $onevideo->getProfileName() . '</a>&nbsp;|&nbsp; <a href="#" class="localnavigation">' . $onevideo->getDescription() . '</a></p>
                        <div class="cream_stars" id="creamstardiv0" alt="' . $onevideo->getTotalViews() . '"><img src="/img/all_creamstars1.png" alt="CreamStar"/></div>
                    </div>
                    ';
            };

            $bigvideo = $this->view->bigVideo;
            $bigvideo = '
                        <div class="creammagdots" style="height: 10px; margin-bottom:-15px;"></div>
                        <p class="creammagDateOfPost"><span>&gt;&nbsp;22 матра&nbsp;</span></p>
                        <div class="creammagUserDataOfPost">
                            <h3 class="creammagH3">&nbsp; ' . $bigvideo->getName() . ' &nbsp;&nbsp;</h3>
                            <div style="margin-top:5px;">
                                <a href="' . $bigvideo->getProfileUrl() . '" class="localauthor"><span class="pen"></span><span class="newsauthor">' . $bigvideo->getProfileName() . '</span></a>
                                <a href="#" class="localcomments"><span class="comment"></span><span class="newsauthor">' . $bigvideo->getTotalComments() . '</span></a>
                                <div class="cream_stars" id="creamstardiv10" alt="' . $bigvideo->getTotalViews() . '" style="float:right;"><img src="/img/all_creamstars.png" alt="CreamStar"/></div>
                            </div>
                            <div class="clear" style="height:10px;"></div>
                            <div><img src="/img/video3.jpg" alt=""/>
                            <p class="creammagMainText">' . $bigvideo->getDescription() . '</p>
                            </div>
                        </div>
            ';

            $html = '
                <div class="creammagshowNewLeft">
                    <ul>
                        <li style="margin-left:-10px;"><span class="left_local_pica"></span><a href="#" class="localnavigationmain center_local_pica">видео</a><span class="right_local_pica"></span></li>
                        <li class="clear"></li>
                        <li ><a href="#" class="localnavigationmain">последние 25</a></li>
                        <li ><a href="#" class="localnavigationmain">последние 50</a></li>
                    </ul>
                    <div class="creammagdots" style="height: 20px;"></div>
                    <ul>
                        ' . $tagsStr . '
                     </ul>
                </div>
                <div class="creammagshowNewCenter">
                    <div style="padding-right:10px;">
                    ' . $bigvideo . '
                    </div>
                    <div class="clear" style="height:20px;"></div>
                    ' . $newvideoStr . '
                        <!--
                    <div class="creammagShortNewsPost">
                        <img alt="" src="/img/n002.jpg" />
                        <h2 class="clear" style="margin-bottom:5px;">Стюарт Фингерхат ...</h2>
                        <div style="margin-left:3px;" class="cream_stars" id="creamstardiv17" alt="2.3"><img src="/img/all_creamstars.png" alt="CreamStar"/></div>
                        <div class="creammagdots" style="height: 5px; margin-top:5px;"></div>
                        <div><a href="#" class="localauthor"><span class="pen"></span><span class="newsauthor">Вилкин</span></a><a href="#" class="localcomments"><span class="comment"></span><span class="newsauthor">14</span></a></div>
                    </div>
                   <div class="creammagShortNewsPost">
                        <img alt="" src="/img/n002.jpg" />
                        <h2 class="clear" style="margin-bottom:5px;">Стюарт Фингерхат ...</h2>
                        <div style="margin-left:3px;" class="cream_stars" id="creamstardiv11" alt="4"><img src="/img/all_creamstars.png" alt="CreamStar"/></div>
                        <div class="creammagdots" style="height: 5px; margin-top:5px;"></div>
                        <div><a href="#" class="localauthor"><span class="pen"></span><span class="newsauthor">Вилкин</span></a><a href="#" class="localcomments"><span class="comment"></span><span class="newsauthor">14</span></a></div>
                    </div>
                    <div class="creammagShortNewsPost">
                        <img alt="" src="/img/n002.jpg" />
                        <h2 class="clear" style="margin-bottom:5px;">Стюарт Фингерхат ...</h2>
                        <div style="margin-left:3px;" class="cream_stars" id="creamstardiv12" alt="3.5"><img src="/img/all_creamstars.png" alt="CreamStar"/></div>
                        <div class="creammagdots" style="height: 5px; margin-top:5px;"></div>
                        <div><a href="#" class="localauthor"><span class="pen"></span><span class="newsauthor">Вилкин</span></a><a href="#" class="localcomments"><span class="comment"></span><span class="newsauthor">14</span></a></div>
                    </div>
                    <div class="creammagShortNewsPost">
                        <img alt="" src="/img/n002.jpg" />
                        <h2 class="clear" style="margin-bottom:5px;">Стюарт Фингерхат ...</h2>
                        <div style="margin-left:3px;" class="cream_stars" id="creamstardiv13" alt="3"><img src="/img/all_creamstars.png" alt="CreamStar"/></div>
                        <div class="creammagdots" style="height: 5px; margin-top:5px;"></div>
                        <div><a href="#" class="localauthor"><span class="pen"></span><span class="newsauthor">Вилкин</span></a><a href="#" class="localcomments"><span class="comment"></span><span class="newsauthor">14</span></a></div>
                    </div>
                    <div class="creammagShortNewsPost">
                        <img alt="" src="/img/n002.jpg" />
                        <h2 class="clear" style="margin-bottom:5px;">Стюарт Фингерхат ...</h2>
                        <div style="margin-left:3px;" class="cream_stars" id="creamstardiv14" alt="1"><img src="/img/all_creamstars.png" alt="CreamStar"/></div>
                        <div class="creammagdots" style="height: 5px; margin-top:5px;"></div>
                        <div><a href="#" class="localauthor"><span class="pen"></span><span class="newsauthor">Вилкин</span></a><a href="#" class="localcomments"><span class="comment"></span><span class="newsauthor">14</span></a></div>
                    </div>
                    <div class="creammagShortNewsPost">
                        <img alt="" src="/img/n002.jpg" />
                        <h2 class="clear" style="margin-bottom:5px;">Стюарт Фингерхат ...</h2>
                        <div style="margin-left:3px;" class="cream_stars" id="creamstardiv15" alt="1.8"><img src="/img/all_creamstars.png" alt="CreamStar"/></div>
                        <div class="creammagdots" style="height: 5px; margin-top:5px;"></div>
                        <div><a href="#" class="localauthor"><span class="pen"></span><span class="newsauthor">Вилкин</span></a><a href="#" class="localcomments"><span class="comment"></span><span class="newsauthor">14</span></a></div>
                    </div>
                    <div class="creammagShortNewsPost">
                        <img alt="" src="/img/n002.jpg" />
                        <h2 class="clear" style="margin-bottom:5px;">Стюарт Фингерхат ...</h2>
                        <div style="margin-left:3px;" class="cream_stars" id="creamstardiv16" alt="1.5"><img src="/img/all_creamstars.png" alt="CreamStar"/></div>
                        <div class="creammagdots" style="height: 5px; margin-top:5px;"></div>
                        <div><a href="#" class="localauthor"><span class="pen"></span><span class="newsauthor">Вилкин</span></a><a href="#" class="localcomments"><span class="comment"></span><span class="newsauthor">14</span></a></div>
                    </div>
                    -->
                </div>
                <div class="creammagshowNewRight">

                    <div class="creamLeftTopShortNewsLine"></div>
                    <div class="creamCenterTopShortNewsLine"></div>
                    <div class="creamRightTopShortNewsLine"></div>

                    <div class="clear creamCenterContentShortNewsLine">
                    <h2 class="creammagh2">Top rated за неделю</h2>
                    <div class="creammagdotswhite" style="height: 20px;"></div>
                        <div>
                        ' . $popvideoStr . '
                            <!--
                            <div><p class="creammagPShort">&gt;&nbsp;<a href="#" class="localauthorshort">Вилкин</a>&nbsp;|&nbsp; <a href="#" class="localnavigation">ролик от Paul John, советую глянуть!</a></p>
                                <div class="cream_stars" id="creamstardiv0" alt="5.5"><img src="/img/all_creamstars1.png" alt="CreamStar"/></div>
                            </div>
                            <div><p class="creammagPShort">&gt;&nbsp;<a href="#" class="localauthorshort">Вилкин</a>&nbsp;|&nbsp; <a href="#" class="localnavigation">ролик от Paul John, советую глянуть!</a></p>
                                <div class="cream_stars" id="creamstardiv1" alt="5"><img src="/img/all_creamstars1.png" alt="CreamStar"/></div>
                            </div>
                            <div><p class="creammagPShort">&gt;&nbsp;<a href="#" class="localauthorshort">Вилкин</a>&nbsp;|&nbsp; <a href="#" class="localnavigation">ролик от Paul John, советую глянуть!</a></p>
                                <div class="cream_stars" id="creamstardiv2" alt="4.3"><img src="/img/all_creamstars1.png" alt="CreamStar"/></div>
                            </div>
                            <div><p class="creammagPShort">&gt;&nbsp;<a href="#" class="localauthorshort">Вилкин</a>&nbsp;|&nbsp; <a href="#" class="localnavigation">ролик от Paul John, советую глянуть!</a></p>
                                <div class="cream_stars" id="creamstardiv3" alt="4.2"><img src="/img/all_creamstars1.png" alt="CreamStar"/></div>
                            </div>
                            <div><p class="creammagPShort">&gt;&nbsp;<a href="#" class="localauthorshort">Вилкин</a>&nbsp;|&nbsp; <a href="#" class="localnavigation">ролик от Paul John, советую глянуть!</a></p>
                                <div class="cream_stars" id="creamstardiv4" alt="4.1"><img src="/img/all_creamstars1.png" alt="CreamStar"/></div>
                            </div>
                            <div><p class="creammagPShort">&gt;&nbsp;<a href="#" class="localauthorshort">Вилкин</a>&nbsp;|&nbsp; <a href="#" class="localnavigation">ролик от Paul John, советую глянуть!</a></p>
                                <div class="cream_stars" id="creamstardiv5" alt="3.7"><img src="/img/all_creamstars1.png" alt="CreamStar"/></div>
                            </div>
                            <div><p class="creammagPShort">&gt;&nbsp;<a href="#" class="localauthorshort">Вилкин</a>&nbsp;|&nbsp; <a href="#" class="localnavigation">ролик от Paul John, советую глянуть!</a></p>
                                <div class="cream_stars" id="creamstardiv6" alt="2.5"><img src="/img/all_creamstars1.png" alt="CreamStar"/></div>
                            </div>
                            <div><p class="creammagPShort">&gt;&nbsp;<a href="#" class="localauthorshort">Вилкин</a>&nbsp;|&nbsp; <a href="#" class="localnavigation">ролик от Paul John, советую глянуть!</a></p>
                                <div class="cream_stars" id="creamstardiv7" alt="2.2"><img src="/img/all_creamstars1.png" alt="CreamStar"/></div>
                            </div>
                            <div><p class="creammagPShort">&gt;&nbsp;<a href="#" class="localauthorshort">Вилкин</a>&nbsp;|&nbsp; <a href="#" class="localnavigation">ролик от Paul John, советую глянуть!</a></p>
                                <div class="cream_stars" id="creamstardiv8" alt="2"><img src="/img/all_creamstars1.png" alt="CreamStar"/></div>
                            </div>
                            <div><p class="creammagPShort">&gt;&nbsp;<a href="#" class="localauthorshort">Вилкин</a>&nbsp;|&nbsp; <a href="#" class="localnavigation">ролик от Paul John, советую глянуть!</a></p>
                                <div class="cream_stars" id="creamstardiv9" alt="1"><img src="/img/all_creamstars1.png" alt="CreamStar"/></div>
                            </div>
                            -->
                            <div class="clear"></div>
                        </div>
                    </div>
                    
                    <div class="creamLeftBottomShortNewsLine"></div>
                    <div class="creamCenterBottomShortNewsLine"></div>
                    <div class="creamRightBottomShortNewsLine"></div>
                    
                    <div class="clear"></div>
                </div>
                <div class="clear"></div>
                ';
            return $html;
	}
}